3.15 \(\int \frac{A+B x}{\left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )} \, dx\)

Optimal. Leaf size=406 \[ \frac{\tanh ^{-1}\left (\frac{e+2 f x}{\sqrt{e^2-4 d f}}\right ) \left (B (a e f-2 b d f+c d e)-A \left (2 a f^2-b e f-2 c d f+c e^2\right )\right )}{\sqrt{e^2-4 d f} \left (f \left (a^2 f-a b e+b^2 d\right )-c \left (b d e-a \left (e^2-2 d f\right )\right )+c^2 d^2\right )}+\frac{\log \left (a+b x+c x^2\right ) (-a B f+A b f-A c e+B c d)}{2 \left (f \left (a^2 f-a b e+b^2 d\right )-c \left (b d e-a \left (e^2-2 d f\right )\right )+c^2 d^2\right )}-\frac{\log \left (d+e x+f x^2\right ) (-a B f+A b f-A c e+B c d)}{2 \left (f \left (a^2 f-a b e+b^2 d\right )-c \left (b d e-a \left (e^2-2 d f\right )\right )+c^2 d^2\right )}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-b (a B f+A c e+B c d)+2 c (-a A f+a B e+A c d)+A b^2 f\right )}{\sqrt{b^2-4 a c} \left (f \left (a^2 f-a b e+b^2 d\right )-c \left (b d e-a \left (e^2-2 d f\right )\right )+c^2 d^2\right )} \]

[Out]

-(((A*b^2*f + 2*c*(A*c*d + a*B*e - a*A*f) - b*(B*c*d + A*c*e + a*B*f))*ArcTanh[(
b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(Sqrt[b^2 - 4*a*c]*(c^2*d^2 + f*(b^2*d - a*b*e +
a^2*f) - c*(b*d*e - a*(e^2 - 2*d*f))))) + ((B*(c*d*e - 2*b*d*f + a*e*f) - A*(c*e
^2 - 2*c*d*f - b*e*f + 2*a*f^2))*ArcTanh[(e + 2*f*x)/Sqrt[e^2 - 4*d*f]])/(Sqrt[e
^2 - 4*d*f]*(c^2*d^2 + f*(b^2*d - a*b*e + a^2*f) - c*(b*d*e - a*(e^2 - 2*d*f))))
 + ((B*c*d - A*c*e + A*b*f - a*B*f)*Log[a + b*x + c*x^2])/(2*(c^2*d^2 + f*(b^2*d
 - a*b*e + a^2*f) - c*(b*d*e - a*(e^2 - 2*d*f)))) - ((B*c*d - A*c*e + A*b*f - a*
B*f)*Log[d + e*x + f*x^2])/(2*(c^2*d^2 + f*(b^2*d - a*b*e + a^2*f) - c*(b*d*e -
a*(e^2 - 2*d*f))))

_______________________________________________________________________________________

Rubi [A]  time = 1.12677, antiderivative size = 398, normalized size of antiderivative = 0.98, number of steps used = 9, number of rules used = 5, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167 \[ \frac{\tanh ^{-1}\left (\frac{e+2 f x}{\sqrt{e^2-4 d f}}\right ) \left (B (a e f-2 b d f+c d e)-A \left (2 a f^2-b e f-2 c d f+c e^2\right )\right )}{\sqrt{e^2-4 d f} \left (f \left (a^2 f-a b e+b^2 d\right )+a c \left (e^2-2 d f\right )-b c d e+c^2 d^2\right )}+\frac{\log \left (a+b x+c x^2\right ) (-a B f+A b f-A c e+B c d)}{2 \left (f \left (a^2 f-a b e+b^2 d\right )+a c \left (e^2-2 d f\right )-b c d e+c^2 d^2\right )}-\frac{\log \left (d+e x+f x^2\right ) (-a B f+A b f-A c e+B c d)}{2 \left (f \left (a^2 f-a b e+b^2 d\right )+a c \left (e^2-2 d f\right )-b c d e+c^2 d^2\right )}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-b (a B f+A c e+B c d)+2 c (-a A f+a B e+A c d)+A b^2 f\right )}{\sqrt{b^2-4 a c} \left (f \left (a^2 f-a b e+b^2 d\right )+a c \left (e^2-2 d f\right )-b c d e+c^2 d^2\right )} \]

Antiderivative was successfully verified.

[In]  Int[(A + B*x)/((a + b*x + c*x^2)*(d + e*x + f*x^2)),x]

[Out]

-(((A*b^2*f + 2*c*(A*c*d + a*B*e - a*A*f) - b*(B*c*d + A*c*e + a*B*f))*ArcTanh[(
b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(Sqrt[b^2 - 4*a*c]*(c^2*d^2 - b*c*d*e + f*(b^2*d
- a*b*e + a^2*f) + a*c*(e^2 - 2*d*f)))) + ((B*(c*d*e - 2*b*d*f + a*e*f) - A*(c*e
^2 - 2*c*d*f - b*e*f + 2*a*f^2))*ArcTanh[(e + 2*f*x)/Sqrt[e^2 - 4*d*f]])/(Sqrt[e
^2 - 4*d*f]*(c^2*d^2 - b*c*d*e + f*(b^2*d - a*b*e + a^2*f) + a*c*(e^2 - 2*d*f)))
 + ((B*c*d - A*c*e + A*b*f - a*B*f)*Log[a + b*x + c*x^2])/(2*(c^2*d^2 - b*c*d*e
+ f*(b^2*d - a*b*e + a^2*f) + a*c*(e^2 - 2*d*f))) - ((B*c*d - A*c*e + A*b*f - a*
B*f)*Log[d + e*x + f*x^2])/(2*(c^2*d^2 - b*c*d*e + f*(b^2*d - a*b*e + a^2*f) + a
*c*(e^2 - 2*d*f)))

_______________________________________________________________________________________

Rubi in Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((B*x+A)/(c*x**2+b*x+a)/(f*x**2+e*x+d),x)

[Out]

Timed out

_______________________________________________________________________________________

Mathematica [A]  time = 1.06166, size = 267, normalized size = 0.66 \[ \frac{\frac{2 \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (-b (a B f+A c e+B c d)+2 c (-a A f+a B e+A c d)+A b^2 f\right )}{\sqrt{4 a c-b^2}}-\frac{2 \tan ^{-1}\left (\frac{e+2 f x}{\sqrt{4 d f-e^2}}\right ) \left (A \left (-2 a f^2+b e f+2 c d f-c e^2\right )+B (a e f-2 b d f+c d e)\right )}{\sqrt{4 d f-e^2}}+\log (a+x (b+c x)) (-a B f+A b f-A c e+B c d)+\log (d+x (e+f x)) (a B f-A b f+A c e-B c d)}{2 \left (f \left (a^2 f-a b e+b^2 d\right )+a c \left (e^2-2 d f\right )-b c d e+c^2 d^2\right )} \]

Antiderivative was successfully verified.

[In]  Integrate[(A + B*x)/((a + b*x + c*x^2)*(d + e*x + f*x^2)),x]

[Out]

((2*(A*b^2*f + 2*c*(A*c*d + a*B*e - a*A*f) - b*(B*c*d + A*c*e + a*B*f))*ArcTan[(
b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] - (2*(B*(c*d*e - 2*b*d*f + a*
e*f) + A*(-(c*e^2) + 2*c*d*f + b*e*f - 2*a*f^2))*ArcTan[(e + 2*f*x)/Sqrt[-e^2 +
4*d*f]])/Sqrt[-e^2 + 4*d*f] + (B*c*d - A*c*e + A*b*f - a*B*f)*Log[a + x*(b + c*x
)] + (-(B*c*d) + A*c*e - A*b*f + a*B*f)*Log[d + x*(e + f*x)])/(2*(c^2*d^2 - b*c*
d*e + f*(b^2*d - a*b*e + a^2*f) + a*c*(e^2 - 2*d*f)))

_______________________________________________________________________________________

Maple [B]  time = 0.014, size = 1698, normalized size = 4.2 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((B*x+A)/(c*x^2+b*x+a)/(f*x^2+e*x+d),x)

[Out]

-1/2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)*f*ln(f*x^2+e*x+
d)*A*b+1/2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)*ln(f*x^2+
e*x+d)*A*c*e+1/2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)*f*l
n(f*x^2+e*x+d)*B*a-1/2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^
2)*ln(f*x^2+e*x+d)*B*c*d+2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e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^2*d^2)*ln(c*x^2+b*x+a)*B*a*f+1/2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*
c*d*e+c^2*d^2)*c*ln(c*x^2+b*x+a)*B*d-2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*
f-b*c*d*e+c^2*d^2)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*a*c*f
+1/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)/(4*a*c-b^2)^(1/2)
*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*b^2*f-1/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^
2+b^2*d*f-b*c*d*e+c^2*d^2)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))
*A*b*c*e+2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)/(4*a*c-b^
2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*c^2*d-1/(a^2*f^2-a*b*e*f-2*a*c*d*
f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2
)^(1/2))*B*a*b*f+2/(a^2*f^2-a*b*e*f-2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)/(
4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*B*a*c*e-1/(a^2*f^2-a*b*e*f-
2*a*c*d*f+a*c*e^2+b^2*d*f-b*c*d*e+c^2*d^2)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4
*a*c-b^2)^(1/2))*B*b*c*d

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)/((c*x^2 + b*x + a)*(f*x^2 + e*x + d)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)/((c*x^2 + b*x + a)*(f*x^2 + e*x + d)),x, algorithm="fricas")

[Out]

Timed out

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x+A)/(c*x**2+b*x+a)/(f*x**2+e*x+d),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{B x + A}{{\left (c x^{2} + b x + a\right )}{\left (f x^{2} + e x + d\right )}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)/((c*x^2 + b*x + a)*(f*x^2 + e*x + d)),x, algorithm="giac")

[Out]

integrate((B*x + A)/((c*x^2 + b*x + a)*(f*x^2 + e*x + d)), x)